package com.dxg.msns.common.pojo;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 * 举报实体类
 * 对应数据库表：report
 * 
 * @author system
 */
@Table(name = "report")
public class Report implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 举报者ID
     */
    @Column(name = "reporter_id")
    private String reporterId;

    /**
     * 被举报者ID
     */
    @Column(name = "reported_id")
    private String reportedId;

    /**
     * 举报类型：1-用户，2-动态，3-音乐，4-评论
     */
    @Column(name = "report_type")
    private Integer reportType;

    /**
     * 举报内容ID（根据类型不同而不同）
     */
    @Column(name = "content_id")
    private String contentId;

    /**
     * 举报原因
     */
    @Column(name = "reason")
    private String reason;

    /**
     * 举报详细描述
     */
    @Column(name = "description")
    private String description;

    /**
     * 举报时间
     */
    @Column(name = "report_time")
    private Date reportTime;

    /**
     * 处理状态：0-待处理，1-已处理，2-已驳回
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 处理时间
     */
    @Column(name = "handle_time")
    private Date handleTime;

    /**
     * 处理人ID
     */
    @Column(name = "handler_id")
    private String handlerId;

    /**
     * 处理结果
     */
    @Column(name = "handle_result")
    private String handleResult;

    // 构造方法
    public Report() {
    }

    public Report(String reporterId, String reportedId, Integer reportType, String contentId, String reason) {
        this.reporterId = reporterId;
        this.reportedId = reportedId;
        this.reportType = reportType;
        this.contentId = contentId;
        this.reason = reason;
        this.reportTime = new Date();
        this.status = 0;
    }

    // Getter 和 Setter 方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getReporterId() {
        return reporterId;
    }

    public void setReporterId(String reporterId) {
        this.reporterId = reporterId;
    }

    public String getReportedId() {
        return reportedId;
    }

    public void setReportedId(String reportedId) {
        this.reportedId = reportedId;
    }

    public Integer getReportType() {
        return reportType;
    }

    public void setReportType(Integer reportType) {
        this.reportType = reportType;
    }

    public String getContentId() {
        return contentId;
    }

    public void setContentId(String contentId) {
        this.contentId = contentId;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getReportTime() {
        return reportTime;
    }

    public void setReportTime(Date reportTime) {
        this.reportTime = reportTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(Date handleTime) {
        this.handleTime = handleTime;
    }

    public String getHandlerId() {
        return handlerId;
    }

    public void setHandlerId(String handlerId) {
        this.handlerId = handlerId;
    }

    public String getHandleResult() {
        return handleResult;
    }

    public void setHandleResult(String handleResult) {
        this.handleResult = handleResult;
    }

    @Override
    public String toString() {
        return "Report{" +
                "id=" + id +
                ", reporterId='" + reporterId + '\'' +
                ", reportedId='" + reportedId + '\'' +
                ", reportType=" + reportType +
                ", contentId='" + contentId + '\'' +
                ", reason='" + reason + '\'' +
                ", description='" + description + '\'' +
                ", reportTime=" + reportTime +
                ", status=" + status +
                ", handleTime=" + handleTime +
                ", handlerId='" + handlerId + '\'' +
                ", handleResult='" + handleResult + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Report report = (Report) o;

        return id != null ? id.equals(report.id) : report.id == null;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}